# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=packetq
pkgver=310.e4fcdd3
pkgrel=1
pkgdesc='A tool that provides a basic SQL-frontend to PCAP-files.'
groups=('blackarch' 'blackarch-networking' 'blackarch-misc')
arch=('x86_64' 'aarch64')
url='https://github.com/DNS-OARC/PacketQ'
license=('GPL3')
depends=('zlib')
makedepends=('git')
source=("$pkgname::git+https://github.com/DNS-OARC/PacketQ.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  ./autogen.sh

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/packetq"

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md CHANGES
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  rm *.md COPYING CHANGES

  cp -a * "$pkgdir/usr/share/$pkgname/"
}

